﻿<local:DocumentBase x:Class="WPFExcelReport.HLTGBMOV"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:ReflectionStudio.Core.Database;assembly=ReflectionStudio.Core"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
                    xmlns:wep="clr-namespace:WPFExcelReport"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    Loaded="Window_Loaded"
                    Title="成品进销存"
                    HorizontalAlignment="Stretch"  Margin="0,0,0,0"  VerticalAlignment="Stretch"
>
    <local:DocumentBase.Resources>
        <Style x:Key="GroupHeaderStyle" TargetType="{x:Type GroupItem}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type GroupItem}">
                        <Expander x:Name="exp" IsExpanded="True"
                          Background="White"
                          Foreground="Black">
                            <Expander.Header>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="{Binding Path=ARTICLE}" />
                                    <TextBlock Text="{Binding Path=ItemCount}" />
                                    <TextBlock Text="Items" />
                                </StackPanel>
                            </Expander.Header>
                            <ItemsPresenter />
                        </Expander>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <db:INTEXDataSet x:Key="iNTEXDataSet" />
        <CollectionViewSource  x:Key="vwICC_WBMOV" Source="{Binding Path=ICC_WBMOV,Source={StaticResource iNTEXDataSet}}">
        </CollectionViewSource>
    </local:DocumentBase.Resources>
    <Grid DataContext=""  HorizontalAlignment="Stretch"  Margin="10,10,0,0"  VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="600" />
            <ColumnDefinition Width="400" />
        </Grid.ColumnDefinitions>
        <WrapPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Name="zoneCommand" Height="34" Margin="0,0,0,6">
            <Button  Content="查询"  Height="23" Margin="10,0,0,0"  Name="btnQuery" Width="75" Click="btnQuery_Click" />
            <Button Content="仅生成报表" Margin="10,0,0,0"   Height="23"   Name="btnReport" Width="75" Click="btnReport_Click" />
            <Button Content="打印报表" Margin="10,0,0,0"  Height="23" Name="btnPrint" Width="90" Click="btnPrint_Click" />
            <Button Content="浏览数据"  Margin="10,0,0,0"  Height="23"  Name="btnPrintPreview" Width="90" Click="btnPrintPreview_Click" />
        </WrapPanel>
        <StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2">
            <WrapPanel>
                <Label Content="开始日期"    Width="80" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                <TextBox Name="txtBYEAR" Width="50" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="Pink" FontSize="18" Text="2011" Foreground="#FF141111" />
                <Label Content="年"    Width="20" Margin="10,0,0,0" HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                <TextBox Name="txtBMONTH" Width="30" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="Beige" Text="10" FontSize="18" Height="30" Foreground="#FF141111" />
                <Label Content="月"    Width="20" Margin="10,0,0,0" HorizontalAlignment="Left"    FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                <TextBox Name="txtBDAY" Width="30" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="YellowGreen" FontSize="18" Text="01" Height="30" Foreground="#FF141111" />
                <Label Content="日"    Width="20" Margin="10,0,0,0" HorizontalAlignment="Left"    FontSize="18" VerticalAlignment="Center" />
                <Label Content="结束日期"    Width="80" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                <TextBox Name="txtEYEAR" Width="50" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="Pink" FontSize="18" Text="2011" Foreground="#FF141111" />
                <Label Content="年"    Width="20" Margin="10,0,0,0" HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                <TextBox Name="txtEMONTH" Width="30" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="Beige" Text="08" FontSize="18" Height="30" Foreground="#FF141111" />
                <Label Content="月"    Width="20" Margin="10,0,0,0" HorizontalAlignment="Left"    FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                <TextBox Name="txtEDAY" Width="30" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="YellowGreen" FontSize="18" Text="01" Height="30" Foreground="#FF141111" />
                <Label Content="日"    Width="20" Margin="10,0,0,0" HorizontalAlignment="Left"    FontSize="18" VerticalAlignment="Center" />
            </WrapPanel>
        </StackPanel>
        <WrapPanel Grid.Row="2"  Grid.Column="0"  Grid.ColumnSpan="2">
            <fd:FilteringDataGrid AutoGenerateColumns="False" EnableRowVirtualization="True"
                                                ItemsSource="{Binding Source={StaticResource ResourceKey=vwICC_WBMOV}}"
                                            HeadersVisibility="Column"
                                              x:Name="MasterDg"
                                                 CanUserReorderColumns="True"
                                  CanUserResizeColumns="True"
                                             CanUserResizeRows="True"
                                              CanUserSortColumns="True"
                                              IsFilteringCaseSensitive="False"
                                              RowDetailsVisibilityMode="VisibleWhenSelected"
                                              Width="Auto"
                                              Height="500"
                                              EnableColumnVirtualization="True"
                                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                              ScrollViewer.VerticalScrollBarVisibility="Auto"
>
                <DataGrid.Columns>
                    <!--品种	后整理	缸号	匹数	码数	客户	出货日期	业务员	货运类型	承运人-->

                    <DataGridTextColumn Binding="{Binding Path=ICCWBMDAT}" Header="日期" Width="SizeToHeader"  MinWidth="40" />
                    <DataGridTextColumn Binding="{Binding Path=ARTICLE}" Header="品种" Width="SizeToCells" MinWidth="120" />
                    <DataGridTextColumn Binding="{Binding Path=ICCWBMBESCHICH}" Header="后整理" Foreground ="Red" Width="SizeToHeader"  MinWidth="40" />
                    <DataGridTextColumn Binding="{Binding Path=ICCWBMDPART}" Header="浆缸" Foreground ="Red" Width="SizeToHeader"  MinWidth="60" />
                    <DataGridTextColumn Binding="{Binding Path=ICCWBMTYPE}" Header="类型" Width="SizeToHeader"  MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=ICCWBMCODE}" Header="CODE" Width="SizeToCells" MinWidth="40" />
                    <DataGridTextColumn Binding="{Binding Path=ICCWBMNAME}" Header="后整厂" Width="SizeToCells" MinWidth="40" />
                    <DataGridTextColumn Binding="{Binding Path=ICCWBMBDES}" Header="描述" Width="SizeToCells" MinWidth="80" />
                    <DataGridTextColumn Binding="{Binding Path=ICCWBMAUFTYP}" Header="单类" Width="SizeToHeader" />
                    <DataGridTextColumn Binding="{Binding Path=ORDERNO}" Header="单号" Width="SizeToCells" />
                    <DataGridTextColumn Binding="{Binding Path=STARTMTR}" Header="期初YD" Width="SizeToHeader" />
                    <DataGridTextColumn Binding="{Binding Path=STARTPCNUM}" Header="期初PC" Width="SizeToHeader" />
                    <DataGridTextColumn Binding="{Binding Path=INMTR}" Header="入库YD" Width="SizeToHeader" />
                    <DataGridTextColumn Binding="{Binding Path=INPCNUM}" Header="入库PC" Width="SizeToHeader" />
                    <DataGridTextColumn Binding="{Binding Path=OUTMTR}" Header="出库YD" Width="SizeToHeader" />
                    <DataGridTextColumn Binding="{Binding Path=OUTPCNUM}" Header="出库PC" Width="SizeToHeader" />
                    <DataGridTextColumn Binding="{Binding Path=ADJMTR}" Header="调整YD" Width="SizeToHeader" />
                    <DataGridTextColumn Binding="{Binding Path=ENDMTR}" Header="期末YD" Width="SizeToHeader" />
                    <DataGridTextColumn Binding="{Binding Path=ENDPCNUM}" Header="期末PC" Width="SizeToHeader" />
                </DataGrid.Columns>
            </fd:FilteringDataGrid>
        </WrapPanel>
    </Grid>
</local:DocumentBase>